
//
//  OrganationBottomCell.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/8/14.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "OrganationBottomCell.h"

@implementation OrganationBottomCell

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        UIImageView *iconImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:iconImageView];
        [iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(10));
            make.width.mas_equalTo(scaleLeftAndRight(100));
            make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(10));
            make.bottom.equalTo(self.contentView.mas_bottom).offset(scaleTopAndBottom(-10));
        }];
        UILabel *titleLabel = [[UILabel alloc] init];
        [self.contentView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(iconImageView.mas_right).offset(scaleLeftAndRight(5));
            make.width.mas_equalTo(scaleLeftAndRight(200));
            make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(10));
            make.height.mas_equalTo(scaleTopAndBottom(20));
        }];
        UILabel *tallyLabel1 = [[UILabel alloc] init];
        [self.contentView addSubview:tallyLabel1];
        [tallyLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(iconImageView.mas_right).offset(scaleLeftAndRight(5));
            make.width.mas_equalTo(scaleLeftAndRight(40));
            make.top.equalTo(titleLabel.mas_bottom).offset(scaleTopAndBottom(5));
            make.height.mas_equalTo(scaleTopAndBottom(20));
        }];
        UILabel *tallyLabel2 = [[UILabel alloc] init];
        [self.contentView addSubview:tallyLabel2];
        [tallyLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(iconImageView.mas_right).offset(scaleLeftAndRight(5));
            make.width.mas_equalTo(scaleLeftAndRight(40));
            make.top.equalTo(titleLabel.mas_bottom).offset(scaleTopAndBottom(5));
            make.height.mas_equalTo(scaleTopAndBottom(20));
        }];
        UIButton *addressbtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:addressbtn];
        [addressbtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.contentView.mas_bottom).offset(scaleTopAndBottom(-10));
            make.left.equalTo(iconImageView.mas_right).offset(scaleLeftAndRight(5));
            make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-50));
            make.height.mas_equalTo(scaleTopAndBottom(20));
        }];
        UIButton *detailbtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:detailbtn];
        [detailbtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(10));
            make.left.equalTo(titleLabel.mas_right).offset(scaleLeftAndRight(5));
            make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-10));
            make.height.mas_equalTo(scaleTopAndBottom(20));
        }];
        UIButton *collectbtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:collectbtn];
        [collectbtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(detailbtn.mas_bottom).offset(scaleTopAndBottom(20));
            make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-10));
            make.height.mas_equalTo(scaleTopAndBottom(40));
            make.width.mas_equalTo(scaleLeftAndRight(30));
        }];
        iconImageView.backgroundColor = [UIColor cyanColor];
        titleLabel.backgroundColor = [UIColor redColor];
        tallyLabel1.backgroundColor = [UIColor greenColor];
        tallyLabel2.backgroundColor = [UIColor greenColor];
        addressbtn.backgroundColor = [UIColor redColor];
        detailbtn.backgroundColor = [UIColor lightGrayColor];
        collectbtn.backgroundColor = [UIColor orangeColor];
    }
    return self;
}

@end
